< previous page page_628 next page >

Page 628
z0648-01.gif
Figure 17.24
Light striking a surface at an angle greater than
the critical angle is internally reflected.
For example, the X component of the vector T is:
e10a6a0a59f035e870d90cca05b85fce.gif
Tx = Lx * n1 / n2 - (Cos(q2) - Cos(q1) * n1 / n2) * Nx
If N and L are unit vectors, then Cos(q1) = N L. To find Cos(q2), you can use Snell's law, plus the fact that Sin2(q) + Cos2(q) = 1.
e10a6a0a59f035e870d90cca05b85fce.gif
Sin(q1) / Sin(q2) = n2 / n1
Sin(q2) = Sin(q1) * n1 / n2
Sin2(q2) = (Sin(q1) * n1 / n2)2 = Sin2(q1) * (n1 / n2)2
1 - Cos2(q2) = (1 - Cos2(q1)) * (n1 / n2)2
Cos2(q2) = 1 - (1 - Cos2(q1)) * (n1 / n2)2
Cos(q2) = Sqr(1 - (1 - Cos2(q1)) * (n1 / n2)2)
The following code fragment calculates the components of the vector T.
e10a6a0a59f035e870d90cca05b85fce.gif
' Find the transmission vector T.
cos1 = Abs(NdotL)
n_ratio = N1 / N2
cos2 = Sqr(1 - (1 - cos1 * cos1) * n_ratio * n_ratio)
cos_factor = cos2 - cos1 * n_ratio
tx = -Lx * n_ratio - cos_factor * nx
ty = -Ly * n_ratio - cos_factor * ny
tz = -Lz * n_ratio - cos_factor * nz
z0648-02.gif
Figure 17.25
Light traveling through a fiber optic cable.

 
< previous page page_628 next page >